<template>
	<view class="">
		<!-- <up-button text="月落"></up-button> -->
		<view class="mainBox">
			<view class="avatar u-flex up-flex-between up-flex-items-center">
				<view class="" style="display: flex;align-items: center;">
					<up-avatar :src="src" :size="45"></up-avatar>
					<text style="margin-left: 20rpx;font-weight: bold;">李兵</text>
				</view>
				<view class="">
					<up-icon name="arrow-right"></up-icon>
				</view>
			</view>
			<view class="booking version" style="margin-top: 50rpx;"
				@click="pathUrl('/pages/reserveResources/reserveResources')">
				<view class="booking-left">
					<up-icon name="order"></up-icon>
					<text>我的预约</text>
				</view>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view class="booking version" @click="pathUrl('/pages/my/message/message')">
				<view class="booking-left">
					<up-icon name="chat"></up-icon>
					<text>查看消息</text>
				</view>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view class="booking version">
				<view class="booking-left">
					<up-icon name="setting"></up-icon>
					<text>版本更新</text>
				</view>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view class="booking version">
				<view class="booking-left">
					<up-icon name="account"></up-icon>
					<text>个人设置</text>
				</view>
				<up-icon name="arrow-right"></up-icon>
			</view>
		</view>
		<view class="loginout">
			<up-button shape="circle" @click="pathUrl('/pages/login/login',3)" type="error">退出登录</up-button>
		</view>
	</view>
</template>

<script setup>
	const pathUrl = (url, type = 1) => {
		if (type == 1) {
			uni.navigateTo({
				url
			})
		} else if (type == 2) {
			uni.switchTab({
				url
			})
		} else {
			uni.clearStorageSync()
			uni.reLaunch({
				url
			})
		}

	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #eee;
	}

	.mainBox {
		.avatar {
			padding: 20rpx 30rpx;
			background-color: white;
		}

		.booking {
			padding: 30rpx;
			background-color: white;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.booking-left {
				display: flex;
				align-items: center;
				color: #323233;

				text {
					margin-left: 10rpx;
					font-size: 24rpx;
				}
			}
		}

		.version {
			margin-top: 0;
			border-bottom: 1rpx solid #eee;
		}
	}

	.loginout {
		padding: 20rpx;
	}
</style>